Skip to content

Conversation

@maswa
Copy link

@maswa maswa commented Feb 7, 2026

What this does

Adds a "Browser Testing" setting with two modes:

  • Full (default): Playwright runs for every feature, same as today
  • Smart: Playwright is only loaded for UI features. API/backend/database features skip it entirely.

This saves ~100-300MB of memory per agent when testing features that don't need a browser, which adds up quickly in parallel mode.

How it works

A new should_use_playwright() function in client.py checks the feature's category against a list of backend keywords (api, backend, database, db, server, endpoint, service). If the category matches, Playwright MCP server and tools are excluded from that agent session.

The setting flows through the full stack:

  • Settings UI → REST API → process manager → agent subprocess → client configuration

Changes

Backend (8 files):

  • client.pyshould_use_playwright() function, conditional Playwright inclusion
  • agent.py — Feature category lookup from DB when in smart mode
  • autonomous_agent_demo.py--testing-mode CLI flag
  • parallel_orchestrator.py — Pass testing_mode to subprocess commands
  • server/routers/agent.py — Read testing_mode from settings, pass to manager
  • server/routers/settings.py — Persist testing_mode setting
  • server/schemas.py — Validation, request/response schemas
  • server/services/process_manager.py — Store and forward testing_mode

Frontend (3 files):

  • SettingsModal.tsx — Full/Smart toggle buttons (disabled when YOLO is on)
  • useProjects.ts — Default setting
  • types.ts — TypeScript types

Test plan

  • Toggle between Full and Smart in Settings, start an agent, verify the correct mode is logged
  • In Smart mode: API feature should log "NO Playwright (testing_mode=smart, category=api)"
  • In Smart mode: UI feature should still get Playwright
  • YOLO mode should override Smart mode (no Playwright regardless)
  • Parallel mode should pass testing_mode to each subprocess

Add a "Browser Testing" setting with two modes:
- Full: Always use Playwright browser for all features (default)
- Smart: Skip Playwright for API/backend features, use only for UI

This reduces memory overhead by ~100-300MB per agent when testing
API features that don't need browser automation.

Changes:
- Add testing_mode to settings schema and API endpoints
- Add should_use_playwright() with category-based logic
- Add UI toggle in Settings modal (Full/Smart buttons)
- Pass testing_mode through orchestrator to agent subprocesses

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant